#include <rtthread.h>
#include "DrvUART010.h"
#include "unione_lite.h"

/* msh code */
int finsh_getchar(void)
{
    char Ch;

    rt_uint32_t  Status;

    while (1)
    {
        Status = GetUartStatus(DEBUG_CONSOLE);
        if (!IsDataReady(Status))
        {
            rt_thread_mdelay(5);
        }
        else
        {
            break;
        }
    }
    Ch = inw(UART_PORT[DEBUG_CONSOLE] + SERIAL_RBR);

    return (Ch);
}

void rt_hw_console_output(const char *str)
{
    const char *cp;
    for (cp = str; *cp != 0; cp++)
        fLib_putchar(DEBUG_CONSOLE, *cp);
}
